package myjava.innerclassi;

public class Root5 {

   // ARGUMENT DEFINED ANONYMOUS INNER CLASS
   public static void main(String[] args) {

      Foo o = new Foo();
      o.doIt(new Bounceable() {
         public void bounce() {
            System.out.println("bounce bounce bounce ...");
         }
      });
   }
}

class Foo {

   void doIt(Bounceable b) {
      b.bounce();
   }
}

interface Bounceable {
   public void bounce();
}